var script = document.createElement('script');
script.src = 'https://translate.google.cn/translate_a/element.js?cb=googleTranslateElementInit';
document.getElementsByTagName('head')[0].appendChild(script);
if (document.documentElement.lang.substr(0, 2) === "zh"){
    document.cookie = "googtrans=/auto/en";
}else {
    document.cookie = "googtrans=/auto/zh-CN";
}
var languages = "en,zh-CN,zh-TW,ja,ru,th,ko,hmn,de,da,eo,nl,ar";
var fanyi_config = document.createElement("script");
var fanyi_config_content = document.createTextNode("function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'auto',includedLanguages: '"+languages+"',layout: google.translate.TranslateElement.InlineLayout.SIMPLE,autoDisplay: true});}");
fanyi_config.appendChild(fanyi_config_content);
document.body.appendChild(fanyi_config);

